package us.gaaoc.framework.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

public class ReferenceCalendarUtility {
	
	/**
	 * Method to retrieve the current time.  Defaults to US Eastern Time Zone.
	 * @return Date object set to the current time.
	 */
	public Date getCurrentTime() {
		// Find the current date and time the signature is being created
		GregorianCalendar currentDate = new GregorianCalendar();
		currentDate.setTimeZone(TimeZone.getTimeZone("America/New York"));
		return currentDate.getTime();
	}
	/**
	 * Method to format a date into a specific format.
	 * @param dateToFormat
	 * @param formatDesired
	 * @return String representation of the date in the format desired.
	 */
	public String formatTime(Date dateToFormat, String formatForDate) {
		SimpleDateFormat sdf;
		String formattedDate = new String();
		
		sdf = new SimpleDateFormat(formatForDate);
		formattedDate = sdf.format(dateToFormat);
	
		return formattedDate;
	}

}
